Configure Trusted Publishing for crates.io #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrates crates.io publishing from manual
CARGO_REGISTRY_TOKENsecret to OIDC-based Trusted Publishing, matching existing PyPI and npm configurations.Changes
.github/workflows/release.yml- Updatedcrates-publishjob:permissions.id-token: writefor OIDC token generationenvironment.name: cratesfor deployment protectionrust-lang/crates-io-auth-action@v1authenticationcrates-publish: name: "Crates: Publish" runs-on: ubuntu-latest needs: crates-verify timeout-minutes: 15 + permissions: + id-token: write + contents: read + environment: + name: crates + url: https://crates.io/crates/feedparser-rs steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 + - name: Authenticate with crates.io + uses: rust-lang/crates-io-auth-action@v1 + id: auth - name: Publish to crates.io run: cargo publish -p feedparser-rs env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}Manual Configuration Required
Before next release:
bug-ops/feedparser-rs→ workflowrelease.yml→ environmentcratescrateswith deployment branch restriction tov*tagsCARGO_REGISTRY_TOKENsecret after successful deploymentSecurity Impact
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.